Skip to content

Drag and Drop Copy Sync or Replace UI#1975

Merged
oneirocosm merged 75 commits intomainfrom
sylvie/copymergeui
Feb 15, 2025
Merged

Drag and Drop Copy Sync or Replace UI#1975
oneirocosm merged 75 commits intomainfrom
sylvie/copymergeui

Conversation

@oneirocosm
Copy link
Contributor

No description provided.

esimkowitz and others added 26 commits February 11, 2025 13:10
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This implementation of fileContentAtom seems incorrect but it prevents
the code editor from rerendering when the contents change. Because of
this, it makes sense to use it in the meantime.
This updates the test behavior to match its description
Prior to this change, copying a directory to a directory that did not
already exist resulted in the new directory containing the original
one. This updates that so the new directory is the same as the original
one but with a different name.
We previously only handle the case of copying the current directory to
an existing directory. This adds another case for when the target
directory does not exist.
This adds the following changes:
- adds a button to perform a merge if a drag and drop copy fails
- only shows the merge option for directories
- renames the overwrite option to "delete then copy" for clarity
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2025

Walkthrough

The changes span modifications in file copy handling, directory navigation, and type enhancements. In the directory preview component, a boolean property is added to indicate directory items, and function signatures are updated to accept this property for copy and retry operations. The drag-and-drop functionality is adjusted to carry this new information, and error handling logic now checks for additional specific error messages. In the preview component, methods for obtaining parent directory information have been updated by replacing the previous API call with a new one that formats remote URIs. Logging in navigation methods has also been updated to clarify when a parent directory does not exist. Lastly, the custom type declaration for dragged files is enhanced by including a boolean property to indicate whether the dragged item is a directory.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62abf39 and 4383b36.

📒 Files selected for processing (3)
  • frontend/app/view/preview/directorypreview.tsx (6 hunks)
  • frontend/app/view/preview/preview.tsx (3 hunks)
  • frontend/types/custom.d.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build for TestDriver.ai
  • GitHub Check: Analyze (go)
🔇 Additional comments (8)
frontend/types/custom.d.ts (1)

432-432: LGTM! Enhanced type safety for directory operations.

The addition of the isDir property to DraggedFile type improves type safety by explicitly tracking whether a dragged item is a directory.

frontend/app/view/preview/directorypreview.tsx (4)

43-43: LGTM! Type enhancement for copy operations.

The addition of isDir to FileCopyStatus type aligns with the drag-and-drop improvements.


903-903: LGTM! Improved error handling for directory operations.

The error handling now properly distinguishes between file and directory operations by:

  1. Accepting isDir parameter in handleDropCopy
  2. Adding directory-specific error message check for "neither overwrite nor merge specified"

Also applies to: 910-912


735-735: LGTM! Enhanced drag-and-drop type safety.

The drag item now includes the isDir property from the original row data, ensuring directory status is preserved during drag operations.


1182-1189: LGTM! Improved UI for directory operations.

The retry UI now provides appropriate options based on whether the item is a directory:

  • "Delete Then Copy" for both files and directories
  • "Sync" option specifically for directories
frontend/app/view/preview/preview.tsx (3)

588-591: LGTM! Simplified parent directory info retrieval.

The code now uses FileInfoCommand directly with formatRemoteUri, making the implementation more consistent and maintainable.


617-617: LGTM! Improved error message clarity.

The error message now clearly indicates that it's the parent directory that doesn't exist.


611-614: LGTM! Consistent path handling.

The code now uses formatRemoteUri consistently for handling parent directory paths.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@oneirocosm oneirocosm merged commit 6d7356f into main Feb 15, 2025
8 checks passed
@oneirocosm oneirocosm deleted the sylvie/copymergeui branch February 15, 2025 01:41
xxyy2024 pushed a commit to xxyy2024/waveterm_aipy that referenced this pull request Jun 24, 2025
Co-authored-by: Evan Simkowitz <esimkowitz@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: sawka <mike@commandline.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants